<template>
  <div class="home">
    <Layout :style="{padding: '0 24px 24px'}">
      <Breadcrumb :style="{margin: '24px 0'}">
        <BreadcrumbItem>二维码管理</BreadcrumbItem>
        <BreadcrumbItem>扫码记录</BreadcrumbItem>
      </Breadcrumb>
      <Content :style="{padding: '24px 182px 24px 24px', minHeight: this.$h.GetContentBodyHeight()+'px', background: '#fff'}">
        <div class="seath_content">
          <DatePicker type="daterange" :options="options2" :value="datatime" @on-change="handleChangeTime" placement="bottom-end" placeholder="请选择时间"
                      style="width: 200px"></DatePicker>
          <Button type="primary" icon="ios-search" @click="searchMember">搜 索</Button>
        </div>
        <Table :loading="loading_" border :columns="columns7" :data="data6" stripe></Table>
        <Page :total="total" :page-size="pagesize" show-total/>

      </Content>
    </Layout>
  </div>
</template>
<script>
  export default {
    props: {},
    components: {},
    data() {
      return {
        loading_:false,
        total:100,
        pagesize:20,
        datatime:'',
        columns7: [
          {
            title: '会员',
            key: 'name',
            width: 350,
            render: (h, params) => {
              return h('div', [
                h('Icon', {
                  props: {
                    type: 'person'
                  }
                }),
                h('strong', params.row.name)
              ]);
            }
          },
          {
            title: '剩余金额',
            key: 'age',
            // width: 200,
          },
          {
            title: 'Address',
            key: 'address',
            width: 450,
          },

        ],
        data6: [
          {
            name: 'John Brown',
            age: 1,
            address: 'New York No. 1 Lake Park'
          },
          {
            name: 'Jim Green',
            age: 2,
            address: 'London No. 1 Lake Park'
          },
          {
            name: 'Joe Black',
            age: 1,
            address: 'Sydney No. 1 Lake Park'
          },
          {
            name: 'Jon Snow',
            age: 2,
            address: 'Ottawa No. 2 Lake Park'
          }
        ],
        options2: {
          shortcuts: [
            {
              text: '最近一周',
              value() {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                return [start, end];
              }
            },
            {
              text: '最近一月',
              value() {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                return [start, end];
              }
            },
            {
              text: '最近三月',
              value() {
                const end = new Date();
                const start = new Date();
                start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                return [start, end];
              }
            }
          ]
        }
      }
    },
    methods: {
      handleChangeTime(data){
        this.datatime = data;
      },
      searchMember() {//搜索 记录
        console.log(this.datatime);
      }
    },
    watch: {},
    computed: {
      //计算属性
    },
    created() {

    },
    mounted() {
      //生命周期
    }
  }
</script>
<style scoped>
  .home {
    width: 100%;
    height: 100%;
  }

  .seath_content {
    width: 100%;
    height: 40px;
  }
</style>
